package com.example.scoredemo.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.example.scoredemo.dao.entity.Student;

import java.util.List;

/**
 * @author :muzi102
 * @time : 2021/3/27
 * @Description
 */
@Dao
public interface StudentDao {
    @Insert
    void insertStduent(Student... students);

    @Update
    void updateStudent(Student... students);

    @Delete
    void deleteStudent(Student... students);

    @Query("DELETE FROM Student")
    void deleteAllStudents();

    @Query("SELECT * FROM Student ORDER BY ID DESC ")
    List<Student> getAllStudents();
}

